\(\int \frac {1}{(3+5 \cos (c+d x))^2} \, dx\) [35]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 12, antiderivative size = 90 \[ \int \frac {1}{(3+5 \cos (c+d x))^2} \, dx=\frac {3 \log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{64 d}-\frac {3 \log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{64 d}+\frac {5 \sin (c+d x)}{16 d (3+5 \cos (c+d x))} \]

[Out]

3/64*ln(2*cos(1/2*d*x+1/2*c)-sin(1/2*d*x+1/2*c))/d-3/64*ln(2*cos(1/2*d*x+1/2*c)+sin(1/2*d*x+1/2*c))/d+5/16*sin
(d*x+c)/d/(3+5*cos(d*x+c))

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2743, 12, 2738, 212} \[ \int \frac {1}{(3+5 \cos (c+d x))^2} \, dx=\frac {5 \sin (c+d x)}{16 d (5 \cos (c+d x)+3)}+\frac {3 \log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{64 d}-\frac {3 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+2 \cos \left (\frac {1}{2} (c+d x)\right )\right )}{64 d} \]

[In]

Int[(3 + 5*Cos[c + d*x])^(-2),x]

[Out]

(3*Log[2*Cos[(c + d*x)/2] - Sin[(c + d*x)/2]])/(64*d) - (3*Log[2*Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])/(64*d)
+ (5*Sin[c + d*x])/(16*d*(3 + 5*Cos[c + d*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2738

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 2743

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((a + b*Sin[c + d*x])^(n
+ 1)/(d*(n + 1)*(a^2 - b^2))), x] + Dist[1/((n + 1)*(a^2 - b^2)), Int[(a + b*Sin[c + d*x])^(n + 1)*Simp[a*(n +
 1) - b*(n + 2)*Sin[c + d*x], x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && LtQ[n, -1] && Integ
erQ[2*n]

Rubi steps \begin{align*} \text {integral}& = \frac {5 \sin (c+d x)}{16 d (3+5 \cos (c+d x))}+\frac {1}{16} \int -\frac {3}{3+5 \cos (c+d x)} \, dx \\ & = \frac {5 \sin (c+d x)}{16 d (3+5 \cos (c+d x))}-\frac {3}{16} \int \frac {1}{3+5 \cos (c+d x)} \, dx \\ & = \frac {5 \sin (c+d x)}{16 d (3+5 \cos (c+d x))}-\frac {3 \text {Subst}\left (\int \frac {1}{8-2 x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{8 d} \\ & = \frac {3 \log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{64 d}-\frac {3 \log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{64 d}+\frac {5 \sin (c+d x)}{16 d (3+5 \cos (c+d x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.59 \[ \int \frac {1}{(3+5 \cos (c+d x))^2} \, dx=\frac {9 \log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+15 \cos (c+d x) \left (\log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )-9 \log \left (2 \cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+20 \sin (c+d x)}{64 d (3+5 \cos (c+d x))} \]

[In]

Integrate[(3 + 5*Cos[c + d*x])^(-2),x]

[Out]

(9*Log[2*Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 15*Cos[c + d*x]*(Log[2*Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] -
Log[2*Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) - 9*Log[2*Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + 20*Sin[c + d*x])/
(64*d*(3 + 5*Cos[c + d*x]))

Maple [A] (verified)

Time = 0.63 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.71

method result size
derivativedivides \(\frac {-\frac {5}{32 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2\right )}{64}-\frac {5}{32 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2\right )}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2\right )}{64}}{d}\) \(64\)
default \(\frac {-\frac {5}{32 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2\right )}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2\right )}{64}-\frac {5}{32 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2\right )}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2\right )}{64}}{d}\) \(64\)
norman \(-\frac {5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{16 d \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-4\right )}+\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2\right )}{64 d}-\frac {3 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2\right )}{64 d}\) \(65\)
risch \(\frac {i \left (3 \,{\mathrm e}^{i \left (d x +c \right )}+5\right )}{8 d \left (5 \,{\mathrm e}^{2 i \left (d x +c \right )}+6 \,{\mathrm e}^{i \left (d x +c \right )}+5\right )}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {3}{5}+\frac {4 i}{5}\right )}{64 d}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {3}{5}-\frac {4 i}{5}\right )}{64 d}\) \(85\)
parallelrisch \(\frac {15 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2\right ) \cos \left (d x +c \right )-15 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2\right ) \cos \left (d x +c \right )+20 \sin \left (d x +c \right )+9 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2\right )-9 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2\right )}{64 d \left (3+5 \cos \left (d x +c \right )\right )}\) \(95\)

[In]

int(1/(3+5*cos(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(-5/32/(tan(1/2*d*x+1/2*c)+2)-3/64*ln(tan(1/2*d*x+1/2*c)+2)-5/32/(tan(1/2*d*x+1/2*c)-2)+3/64*ln(tan(1/2*d*
x+1/2*c)-2))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.98 \[ \int \frac {1}{(3+5 \cos (c+d x))^2} \, dx=-\frac {3 \, {\left (5 \, \cos \left (d x + c\right ) + 3\right )} \log \left (\frac {3}{2} \, \cos \left (d x + c\right ) + 2 \, \sin \left (d x + c\right ) + \frac {5}{2}\right ) - 3 \, {\left (5 \, \cos \left (d x + c\right ) + 3\right )} \log \left (\frac {3}{2} \, \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right ) + \frac {5}{2}\right ) - 40 \, \sin \left (d x + c\right )}{128 \, {\left (5 \, d \cos \left (d x + c\right ) + 3 \, d\right )}} \]

[In]

integrate(1/(3+5*cos(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/128*(3*(5*cos(d*x + c) + 3)*log(3/2*cos(d*x + c) + 2*sin(d*x + c) + 5/2) - 3*(5*cos(d*x + c) + 3)*log(3/2*c
os(d*x + c) - 2*sin(d*x + c) + 5/2) - 40*sin(d*x + c))/(5*d*cos(d*x + c) + 3*d)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 228 vs. \(2 (78) = 156\).

Time = 0.66 (sec) , antiderivative size = 228, normalized size of antiderivative = 2.53 \[ \int \frac {1}{(3+5 \cos (c+d x))^2} \, dx=\begin {cases} \frac {x}{\left (5 \cos {\left (2 \operatorname {atan}{\left (2 \right )} \right )} + 3\right )^{2}} & \text {for}\: c = - d x - 2 \operatorname {atan}{\left (2 \right )} \vee c = - d x + 2 \operatorname {atan}{\left (2 \right )} \\\frac {x}{\left (5 \cos {\left (c \right )} + 3\right )^{2}} & \text {for}\: d = 0 \\\frac {3 \log {\left (\tan {\left (\frac {c}{2} + \frac {d x}{2} \right )} - 2 \right )} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{64 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - 256 d} - \frac {12 \log {\left (\tan {\left (\frac {c}{2} + \frac {d x}{2} \right )} - 2 \right )}}{64 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - 256 d} - \frac {3 \log {\left (\tan {\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 \right )} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{64 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - 256 d} + \frac {12 \log {\left (\tan {\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 \right )}}{64 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - 256 d} - \frac {20 \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{64 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} - 256 d} & \text {otherwise} \end {cases} \]

[In]

integrate(1/(3+5*cos(d*x+c))**2,x)

[Out]

Piecewise((x/(5*cos(2*atan(2)) + 3)**2, Eq(c, -d*x - 2*atan(2)) | Eq(c, -d*x + 2*atan(2))), (x/(5*cos(c) + 3)*
*2, Eq(d, 0)), (3*log(tan(c/2 + d*x/2) - 2)*tan(c/2 + d*x/2)**2/(64*d*tan(c/2 + d*x/2)**2 - 256*d) - 12*log(ta
n(c/2 + d*x/2) - 2)/(64*d*tan(c/2 + d*x/2)**2 - 256*d) - 3*log(tan(c/2 + d*x/2) + 2)*tan(c/2 + d*x/2)**2/(64*d
*tan(c/2 + d*x/2)**2 - 256*d) + 12*log(tan(c/2 + d*x/2) + 2)/(64*d*tan(c/2 + d*x/2)**2 - 256*d) - 20*tan(c/2 +
 d*x/2)/(64*d*tan(c/2 + d*x/2)**2 - 256*d), True))

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.01 \[ \int \frac {1}{(3+5 \cos (c+d x))^2} \, dx=-\frac {\frac {20 \, \sin \left (d x + c\right )}{{\left (\frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 4\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} + 3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 2\right ) - 3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 2\right )}{64 \, d} \]

[In]

integrate(1/(3+5*cos(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/64*(20*sin(d*x + c)/((sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 4)*(cos(d*x + c) + 1)) + 3*log(sin(d*x + c)/(co
s(d*x + c) + 1) + 2) - 3*log(sin(d*x + c)/(cos(d*x + c) + 1) - 2))/d

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.69 \[ \int \frac {1}{(3+5 \cos (c+d x))^2} \, dx=-\frac {\frac {20 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4} + 3 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \right |}\right ) - 3 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \right |}\right )}{64 \, d} \]

[In]

integrate(1/(3+5*cos(d*x+c))^2,x, algorithm="giac")

[Out]

-1/64*(20*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 - 4) + 3*log(abs(tan(1/2*d*x + 1/2*c) + 2)) - 3*log(abs
(tan(1/2*d*x + 1/2*c) - 2)))/d

Mupad [B] (verification not implemented)

Time = 14.18 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.52 \[ \int \frac {1}{(3+5 \cos (c+d x))^2} \, dx=-\frac {3\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}\right )}{32\,d}-\frac {5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-4\right )} \]

[In]

int(1/(5*cos(c + d*x) + 3)^2,x)

[Out]

- (3*atanh(tan(c/2 + (d*x)/2)/2))/(32*d) - (5*tan(c/2 + (d*x)/2))/(16*d*(tan(c/2 + (d*x)/2)^2 - 4))